import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

public class Demo1 {
    public static void main(String[] args) {
        try(OutputStream outputStream=new FileOutputStream("./out.txt",true)){      //默认会创建文件   使用true就是追加写,不会清除
            outputStream.write(97);
            outputStream.write(98);
            outputStream.write(99);

            byte[]arr={97,98,99,100};
            outputStream.write(arr);       //写入多个
        }catch (IOException e) {
            e.printStackTrace();
        }
    }
}
